Skip to content

Fix/memory log interval - #8

Merged
ashleyhindle merged 2 commits into
WhispPHP:mainfrom
malekkadri:fix/memory-log-interval
Oct 22, 2026
Merged

ashleyhindle merged 2 commits into
WhispPHP:mainfrom
malekkadri:fix/memory-log-interval

Conversation

@malekkadri

Copy link
Copy Markdown
Contributor

Summary

Fix periodic memory usage logging in the SSH server.

The existing implementation uses DateInterval::format('%s'), which returns only the seconds component (0–59) rather than the total elapsed seconds. Since the default logging interval is 180 seconds, periodic memory logging never triggers.

Changes

  • Calculate total elapsed seconds using timestamps.
  • Trigger memory logging when the configured interval is reached (>=).
  • Preserve existing logging behavior and output.
  • Add regression tests covering the default 180-second interval and a custom 30-second interval.

Testing

  • Verified the changes are limited to the memory logging logic and regression tests.
  • Added deterministic Pest tests without time-based sleeps.
  • Full Pest suite and PHP Pint checks are pending CI validation.

@ashleyhindle
ashleyhindle merged commit 0e0e27e into WhispPHP:main Oct 22, 2026
3 checks passed
@ashleyhindle

Copy link
Copy Markdown
Collaborator

Thanks @malekkadri 🙏

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants